﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Host.Model;
using Host.DB;

namespace Host.CTR
{
   public class LocationCtr
    {
       private DBLocation dbl = new DBLocation();
       private DBTest dbt = new DBTest();

       public LocationCtr()
       {

       }
        

       public List<Location> getLocation()
       {
           
          return dbl.GetCities();

       }

       public Location getCityByID(string ID)
       {
           return dbl.GetCityByID(ID);
        }

       public Location insertLocation(String city)
       {
           
           Location location = new Location(city);
           dbl.insertLocation(location);
           return location;
       }

       public Location updateLocation(String city, int ID)
       {
           Location location = new Location(city);
           dbl.updateLocation(city, ID);
           return location;
       }

      
    }
}
